package ldh.im.fxbase.data.pojo.status;

import ldh.rpc.dto.ValueEnum;

public enum ImSessionType implements ValueEnum<Byte> {
    chat(1, "聊天"),
    notice(2, "公告"),
    ;

    private Byte value;
    private String desc;

    private ImSessionType(Integer value, String desc){
        this.value = value.byteValue();
        this.desc = desc;
    }

    @Override
    public Byte getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static ImSessionType getByValue(Integer value) {
        if (value == null) return null;
        for (ImSessionType sessionType : ImSessionType.values()) {
            if (sessionType.getValue() == value.byteValue()) {
                return sessionType;
            }
        }

        throw new RuntimeException("ImSessionType不支持这个值：" + value);
    }
}
